package com.ruoyi.fit.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fit.mapper.HealthExerciseMapper;
import com.ruoyi.fit.domain.HealthExercise;
import com.ruoyi.fit.service.IHealthExerciseService;
import com.ruoyi.common.core.text.Convert;

/**
 * 运动健身数据Service业务层处理
 * 
 * @author useragent-1
 * @date 2025-05-16
 */
@Service
public class HealthExerciseServiceImpl implements IHealthExerciseService 
{
    @Autowired
    private HealthExerciseMapper healthExerciseMapper;

    /**
     * 查询运动健身数据
     * 
     * @param id 运动健身数据主键
     * @return 运动健身数据
     */
    @Override
    public HealthExercise selectHealthExerciseById(Long id)
    {
        return healthExerciseMapper.selectHealthExerciseById(id);
    }

    /**
     * 查询运动健身数据列表
     * 
     * @param healthExercise 运动健身数据
     * @return 运动健身数据
     */
    @Override
    public List<HealthExercise> selectHealthExerciseList(HealthExercise healthExercise)
    {
        return healthExerciseMapper.selectHealthExerciseList(healthExercise);
    }

    /**
     * 新增运动健身数据
     * 
     * @param healthExercise 运动健身数据
     * @return 结果
     */
    @Override
    public int insertHealthExercise(HealthExercise healthExercise)
    {
        healthExercise.setCreateTime(DateUtils.getNowDate());
        return healthExerciseMapper.insertHealthExercise(healthExercise);
    }

    /**
     * 修改运动健身数据
     * 
     * @param healthExercise 运动健身数据
     * @return 结果
     */
    @Override
    public int updateHealthExercise(HealthExercise healthExercise)
    {
        healthExercise.setUpdateTime(DateUtils.getNowDate());
        return healthExerciseMapper.updateHealthExercise(healthExercise);
    }

    /**
     * 批量删除运动健身数据
     * 
     * @param ids 需要删除的运动健身数据主键
     * @return 结果
     */
    @Override
    public int deleteHealthExerciseByIds(String ids)
    {
        return healthExerciseMapper.deleteHealthExerciseByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除运动健身数据信息
     * 
     * @param id 运动健身数据主键
     * @return 结果
     */
    @Override
    public int deleteHealthExerciseById(Long id)
    {
        return healthExerciseMapper.deleteHealthExerciseById(id);
    }
}
